package com.wx.chapter8.homework13;

/**
 * ClassName:Student
 * Package :com.wx.chapter8.homework13
 * Description :
 *
 * @Author : coder_mu
 * @Create : 2023/5/29 - 20:38
 */
public class Student extends Person {
    private int stu_id;//学生特有的属性 学号

    public Student(String name, char gender, int age) {
        super(name, gender, age);
    }

    public Student(String name, char gender, int age, int stu_id) {
        super(name, gender, age);
        this.stu_id = stu_id;
    }

    //教师教书
    public void study() {
        System.out.println("我承诺，我会好好学习");
    }

    @Override
    public String play() {
        return super.getName() + "爱玩足球";
    }

    //打印信息方法
    @Override
    public void printInfo() {
        super.printInfo();
        System.out.println("学号:" + this.stu_id);
        study();
        System.out.println(play());
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + getName() + '\'' +
                ", gender=" + getGender() +
                ", age=" + getAge() +
                '}';
    }
}
